package com.ybwh.springboot2.enums;

import com.fasterxml.jackson.annotation.JsonFormat;
import com.fasterxml.jackson.databind.annotation.JsonDeserialize;
import com.fasterxml.jackson.databind.annotation.JsonSerialize;
import com.fasterxml.jackson.datatype.jsr310.deser.LocalDateTimeDeserializer;
import com.fasterxml.jackson.datatype.jsr310.ser.LocalDateTimeSerializer;
import com.ybwh.springboot2.common.enumhub.enumat.EnumField;
import com.ybwh.springboot2.common.enumhub.enumat.EnumAtSerializer;
import com.ybwh.springboot2.common.jackson.mask.MaskField;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;

import java.time.LocalDateTime;

/**
 * 描述信息
 *
 * @author fanbeibei
 * @version 1.0
 * @date 2020/9/7 17:14
 */
@Data
@NoArgsConstructor
@AllArgsConstructor
public class PersonDTO {
    @MaskField(beginIndex = 4,endIndex = 8,maskChar = '#')
    private String name;
    private Integer age;


    @JsonSerialize(using = LocalDateTimeSerializer.class)
    @JsonDeserialize(using = LocalDateTimeDeserializer.class)
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    private LocalDateTime birthday;

    @EnumField(HobyEnum.class)
    private String hoby;

}
